/**
 * Created by hxpeng on 2017/3/24.
 */
(function () {
    'use strict';

    angular.module('App.pages.class', [])
        .config(routeConfig);

    function routeConfig($stateProvider) {

        $stateProvider.state('classMenu', {
            url: "/class",
            abstract: true,
            templateUrl: 'source/pages/page-tab.html',
        }).state('classMenu.index', {
            url: "/index",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/index/index.html',
                    controller:'ClassCtrl as vm'
                }
            }
        }).state('classMenu.classInfo', {
            url: "/classInfo",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/info/index.html',
                    controller:'ClassInfoCtrl as vm'
                }
            }
        }).state('classMenu.classNotice',{
            url: "/classNotice",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/notice/list.html',
                    controller:'ClassNoticeCtrl as vm'
                }
            }
        }).state('classMenu.noticeInfo',{
            url: "/noticeInfo/{noticeId:string}",
            params: {
                noticeId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/notice/index.html',
                    controller: 'ClassNoticeInfoCtrl as vm',
                    resolve: {
                        noticeId: function($stateParams){
                            return $stateParams.noticeId;
                        },
                    }
                }
            }
        }).state('classMenu.classActivity',{
            url: "/classActivity",
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/activity/list.html',
                    controller: 'ClassActivityCtrl as vm'
                }
            }
        }).state('classMenu.activityInfo',{
            url: "/activityInfo/{activityId:string}",
            params: {
                activityId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/activity/index.html',
                    controller: 'ClassActivityInfoCtrl as vm',
                    resolve: {
                        activityId: function($stateParams){
                            return $stateParams.activityId;
                        },
                    }
                }
            }
        }).state('classMenu.teacherEntrustList', {
            url: "/teacherEntrustList",
            cache: true,
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/entrust/teacher-entrust-list.html',
                    controller:'TeacherEntrustCtrl as vm'
                }
            }
        }).state('classMenu.teacherEntrustInfo', {
            url: "/teacherEntrustInfo/{entrustId:string}",
            cache: false,
            params: {
                entrustId: null
            },
            views: {
                'kinder-view': {
                    templateUrl: 'source/pages/class/entrust/teacher-entrust-info.html',
                    controller:'TeacherEntrustInfoCtrl as vm',
                    resolve: {
                        entrustId: function($stateParams){
                            return $stateParams.entrustId;
                        }
                    }
                }
            }
        });
    }

})();